var ModelFactory=function(){
	
};

ModelFactory.prototype.createModel=function(context,type){
	var currentComponentId=context.currentComponentId;
	var childComponentModel = {
		"type": type,
		"id": "component"+currentComponentId,
		"propertyMap":{},
		"children": []
	};
	if(type=="page"){
		childComponentModel["propertyMap"]["pageCode"]=context.pageCode;
		childComponentModel["propertyMap"]["title"]=context.name;
	}else if(type=="tabpage"){
		childComponentModel["labelExpression"]="标题";
	}else if(type=="label"){
		childComponentModel["labelExpression"]="标签";
	}else if(type=="button"){
		childComponentModel["label"]="按钮";
	}else if(type=="grouptitle"){
		childComponentModel["title"]="标题";
	}else if(type=="tabcontrol" ||type=="row" ||type=="col" ||type=="div"){
		console.log("");
	}else{
		childComponentModel["propertyMap"]["labelExpression"]="标签";
		if(context.noLabel===true){
			childComponentModel["noLabel"]=true;
		}
	}
	return childComponentModel;
}

export default new ModelFactory()